package caihan

/**
 * AndroidX依赖管理
 *
 * 不带 ktx 后缀的为 java 依赖，核心功能在此库
 * 带 ktx 后缀为 kotlin 依赖，提供很多方便的扩展函数, ktx 默认引入不带 ktx 的库
 * 依赖关系参考 https://juejin.im/post/5e567ee1518825494466a938
 *
 * @author Seven-C
 * @date 2020/7/27
 */
@Suppress("SpellCheckingInspection")
object AndroidX {
    const val appcompat = "androidx.appcompat:appcompat:1.2.0"
    const val recyclerView = "androidx.recyclerview:recyclerview:1.1.0"
    const val coreKtx = "androidx.core:core-ktx:1.3.2"
    const val constraintlayout = "androidx.constraintlayout:constraintlayout:2.0.4"
    const val cardview = "androidx.cardview:cardview:1.0.0"
    const val activityKtx = "androidx.activity:activity-ktx:1.2.2"
    const val viewpager = "androidx.viewpager:viewpager:1.0.0"
    const val viewpager2 = "androidx.viewpager2:viewpager2:1.0.0"
    const val multidex = "androidx.multidex:multidex:2.0.1"
    const val appStartup = "androidx.startup:startup-runtime:1.0.0-alpha02"


    object Fragment {
        private const val fragment_version = "1.3.2"
        const val fragment = "androidx.fragment:fragment:$fragment_version"
        const val fragmentKtx = "androidx.fragment:fragment-ktx:$fragment_version"
    }

    //生命周期组件相关

    object Lifecycle {
        private const val lifecycle_version = "2.3.1"

        // ViewModel
        const val viewModelKtx = "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"

        // LiveData
        const val liveDataKtx = "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"

        // Lifecycles only (without ViewModel or LiveData)
        const val runtimeKtx = "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"

        // Saved state module for ViewModel
        const val viewmodelSavedstate =
            "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"

        // Annotation processor
        const val compilerKapt = "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"

        // alternately - if using Java8, use the following instead of lifecycle-compiler
        const val commonJava8 = "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"

        // optional - helpers for implementing LifecycleOwner in a Service
        const val service = "androidx.lifecycle:lifecycle-service:$lifecycle_version"

        // optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
        const val process = "androidx.lifecycle:lifecycle-process:$lifecycle_version"

        // optional - ReactiveStreams support for LiveData
        const val reactivestreamsKtx =
            "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version"
    }


    object Navigation {
        private const val navigation_version = "2.3.4"
        const val fragmentKtx = "androidx.navigation:navigation-fragment-ktx:$navigation_version"
        const val uiKtx = "androidx.navigation:navigation-ui-ktx:$navigation_version"
        const val dynamicFeaturesFragment =
            "androidx.navigation:navigation-dynamic-features-fragment:$navigation_version"
    }


    object Paging {
        private const val paging_version = "2.1.1"

        // For Kotlin use paging-runtime-ktx
        const val pagingRuntime = "androidx.paging:paging-runtime:$paging_version"

        // optional - RxJava support For Kotlin use paging-rxjava2-ktx
        const val pagingRxjava2 = "androidx.paging:paging-rxjava2:$paging_version"
    }

    object Room {
        private const val room_version = "2.2.6"
        const val roomRuntime = "androidx.room:room-runtime:$room_version"
        const val roomCompilerKapt = "androidx.room:room-compiler:$room_version"

        // optional - Kotlin Extensions and Coroutines support for Room
        const val roomKtx = "androidx.room:room-ktx:$room_version"
    }

    object Hilt {
        private const val hit_version = "2.28-alpha"
        private const val hit_viewmodule_version ="1.0.0-alpha01"
        val hiltAndroid = "com.google.dagger:hilt-android:${hit_version}"
        val hiltAndroidCompilerKapt = "com.google.dagger:hilt-android-compiler:${hit_version}"
        val hiltViewModule = "androidx.hilt:hilt-lifecycle-viewmodel:${hit_viewmodule_version}"
        val hiltViewModuleCompilerKapt = "androidx.hilt:hilt-compiler:${hit_viewmodule_version}"
    }
}